package com.settlement.system.model.entity.common;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.settlement.system.converter.BillCategoryConvert;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;
/**
 * 收退款-记账项目主表
 * @author Ximi
 * @since 2020-07-06
 */
@Data
@ExcelIgnoreUnannotated
@HeadStyle(fillBackgroundColor = 9,fillForegroundColor = 9)
@HeadRowHeight(value = 20)
@HeadFontStyle(fontHeightInPoints = 14)
public class TblRrRecordProjectMain extends BaseModel implements Serializable {


    /**
     * 编码
     */
    @ApiModelProperty(hidden = true,value = "渠道")
    private String channelNo;

    /**
     * 渠道
     */
    @ColumnWidth(7)
    @ExcelProperty(value = "渠道")
    @ApiModelProperty(value = "渠道")
    private String channelName;

    /**
     * 账单大类
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "账单大类",converter = BillCategoryConvert.class)
    @ApiModelProperty(value = "账单大类（1、平台账单，2、营销工具，3、手工调账）")
    @NotBlank(message = "账单大类不能为空")
    @Pattern(regexp="^[1-3]{1}$",message="【账单大类】的值只能为 [平台账单]、[营销工具]或[手工调账]")
    private String billCategory;

    /**
     * 账单类型
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "账单类型")
    @ApiModelProperty(value = "账单类型")
    private String billType;

    /**
     * 是否资金账户数据
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "是否资金账户数据")
    @ApiModelProperty(value = "是否资金账户数据")
    private String isCapitalAccountData;

    /**
     * 判断字段
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "判断字段")
    @ApiModelProperty(value = "判断字段")
    private String decideField;

    /**
     * 原始账单项目
     */
    @ColumnWidth(19)
    @ExcelProperty(value = "原始账单项目")
    @ApiModelProperty(value = "原始账单项目")
    private String originBillProject;

    /**
     * 记账项目
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "记账项目")
    @ApiModelProperty(value = "记账项目")
    private String recordAccountProject;

    /**
     * 费用大类
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "费用大类")
    @ApiModelProperty(value = "费用大类")
    private String costCategory;

    /**
     * 收费项目
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "收费项目")
    @ApiModelProperty(value = "收费项目")
    private String chargeProject;

    /**
     * 凭证类型
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "凭证类型")
    @ApiModelProperty(value = "凭证类型")
    private String voucherType;

    /**
     * 稽核标识
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "稽核标识")
    @ApiModelProperty(value = "稽核标识")
    private String auditMark;

    /**
     * 是否参与记账
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "是否参与记账")
    @ApiModelProperty(value = "是否参与记账")
    private String isJoinRecordAccount;

    /**
     * NC客商
     */
    @ColumnWidth(10)
    @ExcelProperty(value = "NC客商")
    @ApiModelProperty(value = "NC客商")
    private String ncCustermerMerchant;

    /**
     * 辅助项_营销工具
     */
    @ColumnWidth(25)
    @ExcelProperty(value = "辅助项_营销工具")
    @ApiModelProperty(value = "辅助项_营销工具")
    private String ncMarketTool;

    /**
     * NC_虚拟账户
     */
    @ColumnWidth(25)
    @ExcelProperty(value = "NC_虚拟账户")
    @ApiModelProperty(value = "NC_虚拟账户")
    private String ncVirtualAccount;



    public String getNcMarketTool() {
        return StringUtils.isEmpty(ncMarketTool) ? "" : ncMarketTool;
    }
}
